﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="admin_Gallary.aspx.cs" Inherits="admin_Gallary" %>
<%@ Import Namespace="Net.Ntalent.Action50.Core.Util"%>
<%@ Import Namespace="Net.Ntalent.Action50.DataAccess"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Admin_Gallery</title>
<link type="text/css" rel="stylesheet" href="css/common.css" />
<link type="text/css" rel="stylesheet" href="css/admin.css" />


<!-- 弹出框所用头文件 S-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>


<!--[if IE 6]>
<style type="text/css">
* html,* html body /* 修正IE6振动bug */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top /* IE6 头部固定 */{position:absolute;margin-top:100px;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
</style>
<![endif]-->



<!--[if IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
<script type="text/javascript">
DD_belatedPNG.fix('div, ul, img, li, input');
</script>
<![endif]-->
<!-- 弹出框所用头文件 E-->









    <script src="js/jquery.min.js" type="text/javascript"></script>
    
<!-- 文件上传控件 S -->
<link rel="Stylesheet" href="js/uploadify.css" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.uploadify.js"></script> 
<script type="text/javascript">
    $(document).ready(function() {
        $('#uploadify').fileUpload({
            'uploader': 'fileupload/uploader.swf',
            'width':'132',
            'height':'33',
            'script': 'Handlers/GallaryHandler.ashx',
            'cancelImg': 'fileupload/cancel.png',
            'fileDesc':"*.jpg;*.gif;*.png;*.jpeg;*.bmp",
	        'fileExt':"*.jpg;*.png;*.gif;*.jpeg;*.bmp",
	        'buttonImg': 'fileupload/browse.png',
            'sizeLimit':'800000',
            'scriptData': { 'action': 'uploadImage', 'gallaryType': '2', 'actionId': getActionId(), 'gallaryDesc': '' },
            'onAllComplete': function() { window.location.reload(); },
            'multi':'true',
            'auto':'true'
        });
    });
</script>
<!-- 文件上传控件 E -->


<script language="javascript">
    function getActionId() {
        if (window.location.search == "") {
            return "";
        }
        else {
            var str = window.location.search.substring(1, window.location.search.length);
            var arry = str.split("&");
            var r = arry[0];
            var result = r.split("=")[1];
            return result;
        }
    }

</script>

</head>

<body>
    <form id="form1" runat="server">
<div class="wrappera">
	<div class="wrapperb">
		<!-- 界面头部 S -->
		<div id="head" class="head">
			<!-- 界面头部 网站LOGO S -->
			<div id="site_logo">
			</div>
			<!-- 界面头部 网站LOGO E -->
			<div id="site_signal">Action Management</div>
			<!-- 界面头部 网站导航栏 S -->
			<div class="site_nav">
				<ul>
					<li class="nowPaged right"><a href="Default.aspx">HOME</a></li>
				</ul>
			</div>
			<!-- 界面头部 网站导航栏 E -->
		</div>
		<!-- 界面头部 E -->

		<!-- 界面主体部分 S -->
		<div class="mainBody">
			<div class="admin_box">
				<!-- 界面主体 管理界面导航栏 S -->
				<div class="admin_nav">
					<ul>
						<li><a href="admin_Basic_Information.aspx?actionId=<%=Request["actionId"] %>">Basic Information</a></li>
						<li><a href="admin_Logs_View.aspx?actionId=<%=Request["actionId"] %>">Log</a></li>
						<li><a href="admin_News_View.aspx?actionId=<%=Request["actionId"] %>">News</a></li>
						<li  class="nowPage" id="news"><a href="admin_Gallary.aspx?actionId=<%=Request["actionId"] %>">Gallery</a></li>
					</ul>
				</div>
				<!-- 界面主体 管理界面导航栏 E -->
				<!-- 界面主体 管理界面 用户信息 S -->
				<div class="userInfo">
					<img src="images/img_userFace.jpg" alt="" />
					<span>Welcome</span><span id="userName"><%=Session[Constants.SESSION_KEY_ADMIN_NAME]%></span><asp:LinkButton
ID="LinkButton4"  runat="server" onclick="LinkButton4_Click">Logout</asp:LinkButton></div>
				<!-- 界面主体 管理界面 用户信息 S -->
				<!-- 界面主体 管理界面 信息列表 S -->
				<div class="newsList">
					<h2><a href="admin_Action_List.aspx">Admin > </a>  
                        <a href="admin_Basic_Information.aspx?actionId=<%=Request["actionId"] %>"> <%=Helper.getSubString(Helper.getActionNameById(Convert.ToInt64(Request["actionId"])), 25) %> > </a> 
                    Gallery</h2>
					<div class="GallaryIntro">
	
                
						<div class="area UpLoad">
<asp:FileUpload  ID="uploadify" runat="server" />

		

	
						</div>

					</div>
					
					<h3 class="gallaryTitle">Gallery List</h3>
					
					<div class="gallaryListContent">
					<!-- 界面主体 管理界面 Gallary列表 S -->


<asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource1" 
                            onitemcommand="ListView1_ItemCommand" ondatabound="ListView1_DataBound" 
                            >

<LayoutTemplate>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</LayoutTemplate>
<ItemTemplate>




<asp:Panel ID="Panel1" CssClass="gallaryList" runat="server">
    							<div class="gallaryPhoto">

								<img src="Handlers/GallaryHandler.ashx?action=getImage&id=<%#((T_GALLARY)Container.DataItem).Id %>" alt="" />
							</div>
							<div class="gallaryWords">
								<span>Name:</span>
								<span>Comment:</span>
<asp:LinkButton class="submitSty" CommandName="submitGallary" CommandArgument="<%#((T_GALLARY)Container.DataItem).Id %>" ID="LinkButton3" runat="server">Submit:</asp:LinkButton>
<asp:LinkButton class="deleteSty" CommandName="deleteGallary" CommandArgument="<%#((T_GALLARY)Container.DataItem).Id %>" ID="LinkButton5" runat="server">Delete:</asp:LinkButton>
<asp:LinkButton ID="LinkButton6" CommandName="setCover" CommandArgument="<%#((T_GALLARY)Container.DataItem).Id %>" runat="server">Set Cover</asp:LinkButton>
							</div>
							<div class="gallaryInput">
<asp:Label ID="Label1"  class="inputA tb_PhotoName" tb_PhotoName  runat="server" Text="Label"><%#((T_GALLARY)Container.DataItem).UPLOAD_FILE_NAME %></asp:Label>
<asp:TextBox class="inputA tb_Comment" id="TextBox1" Text="<%#((T_GALLARY)Container.DataItem).GALLARY_DESC %>" runat="server" TextMode="MultiLine"></asp:TextBox>

							</div>

</asp:Panel>

</ItemTemplate>
</asp:ListView>


	
						
					    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                            SelectMethod="RetrieveByAction" 
                            TypeName="Net.Ntalent.Action50.Core.Dao.GallaryDao">
                            <SelectParameters>
                                <asp:QueryStringParameter DefaultValue="0" Name="id" 
                                    QueryStringField="actionId" Type="Int64" />
                                <asp:Parameter DefaultValue="3" Name="gallaryType" Type="Object" />
                                <asp:Parameter DefaultValue="0" Name="pageNumber" Type="Int32" />
                                <asp:Parameter DefaultValue="0" Name="pageSize" Type="Int32" />
                                <asp:Parameter DefaultValue="UPLOAD_DATE DESC" Name="orderBy" Type="String" />
                            </SelectParameters>
                        </asp:ObjectDataSource>
	
						<div></div>
					<div class="turnPage right">

<asp:DataPager PagedControlID="ListView1" ID="DataPager1" runat="server" PageSize="12">
    <Fields>
        <asp:NextPreviousPagerField ButtonType="Link" ShowNextPageButton="false" ShowLastPageButton="false"
            ShowFirstPageButton="true"  FirstPageText="First" RenderNonBreakingSpacesBetweenControls="false" 
            ShowPreviousPageButton="true" PreviousPageText="&lt; Previous" ButtonCssClass="linkB left"
             /> 

        <asp:NumericPagerField  ButtonType=Link CurrentPageLabelCssClass="linkC left" NumericButtonCssClass="linkC left" RenderNonBreakingSpacesBetweenControls="false" ButtonCount=10/>

        <asp:NextPreviousPagerField ButtonType="Link"  ButtonCssClass="linkB left" ShowFirstPageButton="false" ShowPreviousPageButton="false"
            ShowNextPageButton="true" NextPageText="Next &gt;"  RenderNonBreakingSpacesBetweenControls="false" 
            ShowLastPageButton="true"  LastPageText="Last"/>
    </Fields>
</asp:DataPager>

						
	
					</div>
												

					<!-- 界面主体 管理界面 Gallary列表 E -->
					</div>
				</div>
				
			</div>
			
		</div>
		<!-- 界面主体部分 E -->
		
		<!-- 界面尾部 S -->
		<div id="footer" class="footer">
		</div>
		<!-- 界面尾部 E -->


	</div>
</div>

<!--pop窗口实现 S-->
<div id="alpha" >
     <div class="popup fixed-top">
	        <h1>
		        <a class="closePopsup"></a>
	        </h1>
	        <div class="area_message">
	        <p>
		        <asp:Label ID="Message" runat="server" Text="Message"></asp:Label>
        		
	        </p>
	        </div>
	        <p class="forBtn">
		        <a class="button1 linkE">确定</a>
	        </p>
        </div>
</div>
    <asp:Literal ID="popupCmd" runat="server" Text=""></asp:Literal>
 <!--pop窗口实现 E-->   



    </form>

</body>

</html>

